package assignment.ton.def;

import java.io.Serializable;

/**
 * The definition of a parameter, contains a name and type
 */
public class Parameter implements Serializable{
	private static final long serialVersionUID = 766324826595534404L;
	protected String name, type;
	protected boolean many;
	public Parameter(String setName, String setType, boolean setMany){
		name = setName;
		type = setType;
		many = setMany;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getType() {
		return type;
	}
	public void setType(String type) {
		this.type = type;
	}
	/**
	 * @return returns in format name: type
	 */
	public String toString(){
		String oneOrMany;
		if(many){ oneOrMany = "Many"; }else{ oneOrMany = "One"; }
		return name+": "+type+" "+oneOrMany;
	}
	public boolean isMany() {
		return many;
	}
	public void setMany(boolean many) {
		this.many = many;
	}

}
